package es

import (
	"fmt"
	"github.com/elastic/go-elasticsearch"
)

var (
	err      error
	EsClient *elasticsearch.Client
)

func Es() {
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://1.94.144.57:9200",
		},
	}

	EsClient, err = elasticsearch.NewClient(cfg)
	if err != nil {
		fmt.Println("es 连接不ok", err)
		return
	}
	fmt.Println("es 连接ok")
	// ...
}
